package Banking_5;

public class Bank {
    private Customer[] customers ;   //用于存放客户
    private int numberofCustomers; //用于记录Customer的个数

    public Bank(){
        numberofCustomers=0;
        customers = new Customer[100];  ///这里记得要初始化!不然要发生java.lang.NullPointerException
    }
    public void addCustomer(String f,String l){
        int i= this.numberofCustomers;
        customers[i]=new Customer(f,l);//新建一个构造对象
        this.numberofCustomers++;
    }
    public int getNumOfCustomers() {
        return numberofCustomers;
    }
    public Customer getCustomer(int index) {
        return customers[index];
    }
}